<%--
  Created by IntelliJ IDEA.
  User: 林不清
  Date: 2020/12/14
  Time: 20:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="entity.User" %>
<%@ page import="org.omg.PortableInterceptor.USER_EXCEPTION" %>
<%@ page import="java.util.List" %>
<%@ page import="entity.Message" %>
<%@ page import="javax.print.DocFlavor" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>短消息管理</title>
    <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
    <link rel="stylesheet" href="css/index.css">
    <script type="text/javascript" src="js/index.js"></script>
</head>
<body>
<%
    List<Message> messages = (List<Message>) request.getSession().getAttribute("messages");
%>
<%request.setCharacterEncoding("utf-8");%>
<div class="righter"style="border: white 5px solid">
    <a href="#" name="message"></a>
    <div class="send_email" style="font-size: 30px;">
        <img src="img/receive.jpg" alt="" style="width: 90px;height: 90px;">
        <p style="float:right; margin-right:1170px;font-weight: bolder">收件箱</p>
    </div>
    <!--            短消息-->
    <div class="message" style="margin-top: 30px">
        <table border="1" cellspacing="0" align="center" id="message" width="100%">
            <tr><td>接收者     </td><td>内容    </td><td>发送者</td><td>是否已读</td><td>操作</td></tr>
            <%
                for(Message m : messages){
            %>
            <tr>
                <td><%=m.getRecipient()%></td>
                <td><%=m.getContent()%></td>
                <td><%=m.getSender()%></td>
                <%
                    String read="";
                    if (m.getIsRead()==1){
                        read="是";
                    }else{
                        read = "否";
                    }
                %>
                <td><%=read%></td>
                <td><a href="show.jhtml?id=<%=m.getMid()%>&uname=<%=m.getRecipient()%>" target="main">详情</a></td>
            </tr>
            <%
                }
            %>
        </table>
    </div>
</div>
</body>
</html>
